n = int(input())
lists = list(map(int, input().split()))
if 0 in lists:
    print(0)
else:
    ans = 1
    Flag = True
    for s in lists:
        ans *= s
        if ans > 1e18:
            Flag = False
            print(-1)
            break
    if Flag:
        print(ans)
